﻿namespace mveEngine.Comparer
{
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.Text;

	public class PosterComparer : IEqualityComparer<Poster>
	{
		public bool Equals(Poster x, Poster y)
		{
			if (x == null || y == null)
			{
				return false;
			}
			
			if (!string.IsNullOrEmpty(x.Id) && !string.IsNullOrEmpty(y.Id)) {
				return x.Id == y.Id;
			}

			if (x.Image.ToLower() == y.Image.ToLower())
			{
				return true;
			}

//			string path;
//			if (ImageUtil.LocalFileExists(x.Image, out path) && FileUtil.Compare(x.Image, y.Image))
//			{
//				return true;
//			}

			return false;
		}

		public int GetHashCode(Poster obj)
		{
			return 0;
		}
	}
}
